//数组拉平
type Flat<T extends any[]> = T extends [infer L, ...infer P]
  ? [...(L extends any[] ? Flat<L> : [L]),...Flat<P>]
  : T;
type a1 = Flat<[1, [2, 3], [4, 5], [6]]>;
type a2 = Flat<[1, 2, 3]>;
type a3 = Flat<[]>;
type a4 = Flat<[1]>;
export {};
